package service.petowner;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import common.db.DBUtils;

public class O_Find implements O_base {

	public List<Map<String, Object>> o_FindPets(String str) throws SQLException {
		List<Map<String, Object>> result=new ArrayList<Map<String,Object>>();
		result=DBUtils.findByname("select * from pet where O_name=?", str);
		return result;
	}

	@Override
	public List<Map<String, Object>> o_Findmoney(String str) throws SQLException {
		List<Map<String, Object>> result=new ArrayList<Map<String,Object>>();
		result=DBUtils.findByname("select O_money from petowner where O_name=?", str);
		return result;
	}

	@Override
	public List<Map<String, Object>> o_FindAccounts(String str) throws SQLException {
		String str1=str;
		List<Map<String, Object>> result=new ArrayList<Map<String,Object>>();
		result=DBUtils.findByname("select * from accounts WHERE outname=? OR inname=?", str,str1);
		return result;
	}

}
